--create
local strval = "123123123123"
--split
print(strval) 
--search
--replace
print(strval.."123123")

print('string.byte(s [, i [, j ]])')
print(string.byte("abc", 1, 3))
print(string.byte("abc", 3)) -- 缺少第三个参数，第三个参数默认与第二个相同，此时为 3
print(string.byte("abc")) 


d = 1229; m = 127; y = 2015                     -- 一行包含几个语句，用；分开
print(string.format("%s %02d/%02d/%d", "today is:", d, m, y))
function split(s,sep)
    local sep,fields = sep or ":",{}
    local pattern = string.format("([^%s]+)",sep)

    s:gsub(pattern,function(c) fields[#fields+1]=c end)

    return fields;

end

print(split("a=1","=")[1] , split("a=1","=")[2] )